package com.henu.rescue.service.impl;

import com.henu.rescue.entity.VO.ComplainVO;
import com.henu.rescue.entity.VO.CostVO;
import com.henu.rescue.mapper.CostMapper;
import com.henu.rescue.service.CostService;
import com.henu.rescue.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CostServiceImpl implements CostService {

    @Autowired
    private CostMapper costMapper;


    @Override
    public Page<CostVO> selectAllCost(Page<CostVO> page) {
        List<CostVO> costVOS = costMapper.selectAllCost(page);
        page.setList(costVOS);
        //查询总数
        int totalCount =costMapper.getCountByPage(page);
        page.setTotalCount(totalCount);
        return page;
    }

    @Override
    public Integer updateFee(CostVO costVO) {
        return costMapper.updateFee(costVO);
    }
}
